﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:local="clr-namespace:Convertor"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:conv="clr-namespace:Wpf.CommonTools.Converter;assembly=Wpf.CommonTools">

    <local:Config x:Key="Config"/>

    <conv:StringNullableConverter x:Key="StringNullableConverter"/>
    <conv:MultiStringFormatConverter x:Key="MultiStringFormatConverter"/>
    <conv:FindUILanguageConverter x:Key="FindUILanguageConverter"/>
    <conv:StringToLimitConverter x:Key="StringToLimitConverter"/>
    <conv:StringCompressConverter x:Key="StringCompressConverter"/>
    <conv:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    <conv:StringFormatConverter x:Key="StringFormatConverter"/>

    <SolidColorBrush x:Key="HeaderBGColor" Color="#FF6493D6"/>
    <SolidColorBrush x:Key="MenuTopFontColor" Color="White" />
    <SolidColorBrush x:Key="MenuSubFontColor" Color="Black" />
    <LinearGradientBrush x:Key="MainBackgroundOpacityMask"
                         StartPoint="0,0"
                         EndPoint="0,1">
        <GradientStop Color="#E5FFFFFF" Offset="0"/>
        <GradientStop Color="#B2FFFFFF" Offset="0.4"/>
        <GradientStop Color="#CCFFFFFF" Offset="1"/>
    </LinearGradientBrush>

    <Style x:Key="WhiteMask" TargetType="Border">
        <Setter Property="Background" Value="#CCFFFFFF"/>
        <Setter Property="Margin" Value="-2,5,-2,-2"/>
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect ShadowDepth="1" Opacity="0.5" Direction="90" />
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NoneStyle" TargetType="FrameworkElement" >
        <Setter Property="Control.Background" Value="Transparent" />
        <Setter Property="Control.BorderThickness" Value="0"/>
        <Setter Property="Control.BorderBrush" Value="{x:Null}"/>
    </Style>
    <Style x:Key="LeftTabControlStype" TargetType="TabControl" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <DockPanel>
                        <Border
                            Background="#CCFFFFFF"
                            BorderBrush="Gray"
                            BorderThickness="0,1,1,1"
                            CornerRadius="0,7,7,0"
                            Margin="0"
                            Padding="5">
                            <ContentPresenter 
                                ContentSource="SelectedContent" />
                        </Border>
                        <Border
                            Panel.ZIndex="50"
                            Background="Transparent"
                            BorderBrush="Transparent"
                            BorderThickness="0">
                            <TabPanel
                                Margin="0,6,0,0"
                                IsItemsHost="True" />
                        </Border>
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="TabControl.Effect">
            <Setter.Value>
                <DropShadowEffect ShadowDepth="3" Opacity="0.1" />
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="LeftTabItemStyle" TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border Name="Border" Margin="-1,2,5,2" Background="Transparent" BorderBrush="Gray" BorderThickness="0" CornerRadius="0,5,5,0">
                            <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center"
                              HorizontalAlignment="Center"
                              ContentSource="Header" Margin="5,15,5,15"
                              RecognizesAccessKey="True">
                                <ContentPresenter.LayoutTransform>
                                    <RotateTransform Angle="90" />
                                </ContentPresenter.LayoutTransform>
                            </ContentPresenter>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter TargetName="Border" Property="Background" Value="#FFF0F2F3"  />
                            <Setter TargetName="Border" Property="BorderThickness" Value="0,1,1,1" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="DarkRed" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="Black" />
                            <Setter Property="Foreground" Value="DarkGray" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RightTabControlStype" TargetType="TabControl" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <DockPanel>
                        <Border
                            Panel.ZIndex="50"
                            Background="Transparent"
                            BorderBrush="Transparent"
                            BorderThickness="0">
                            <TabPanel
                                Margin="0,6,0,0"
                                IsItemsHost="True" />
                        </Border>
                        <Border
                            Background="#CCFFFFFF"
                            BorderBrush="Gray"
                            BorderThickness="1,1,0,1"
                            CornerRadius="7,0,0,7"
                            Margin="0"
                            Padding="5">
                            <ContentPresenter 
                                ContentSource="SelectedContent" />
                        </Border>
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="TabControl.Effect">
            <Setter.Value>
                <DropShadowEffect ShadowDepth="3" Opacity="0.1" Direction="270" />
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RightTabItemStyle" TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border Name="Border" Margin="5,2,-1,2" Background="Transparent" 
                                BorderBrush="Gray" BorderThickness="0" CornerRadius="5,0,0,5">
                            <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center"
                              HorizontalAlignment="Center"
                              ContentSource="Header" Margin="5,15,5,15"
                              RecognizesAccessKey="True">
                                <ContentPresenter.LayoutTransform>
                                    <RotateTransform Angle="270" />
                                </ContentPresenter.LayoutTransform>
                            </ContentPresenter>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter TargetName="Border" Property="Background" Value="#FFF0F2F3"  />
                            <Setter TargetName="Border" Property="BorderThickness" Value="1,1,0,1" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="DarkRed" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="Black" />
                            <Setter Property="Foreground" Value="DarkGray" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="BottomTabControlStype" TargetType="TabControl" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <DockPanel>
                        <Border
                            DockPanel.Dock="Top"
                            Panel.ZIndex="50"
                            Background="Transparent"
                            BorderBrush="Transparent"
                            BorderThickness="0">
                            <TabPanel
                                Margin="6,0,0,0"
                                IsItemsHost="True" />
                        </Border>
                        <Border
                            Background="#CCFFFFFF"
                            BorderBrush="Gray"
                            BorderThickness="1,1,1,1"
                            CornerRadius="7,7,7,7"
                            Margin="0"
                            Padding="5">
                            <ContentPresenter 
                                ContentSource="SelectedContent" />
                        </Border>
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="TabControl.Effect">
            <Setter.Value>
                <DropShadowEffect ShadowDepth="3" Opacity="0.1" Direction="315" />
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="BottomTabItemStyle" TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border Name="Border" Margin="0,3,5,-1" Background="Transparent" BorderBrush="Gray" BorderThickness="0" CornerRadius="5,5,0,0" MaxWidth="150">
                            <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center"
                              HorizontalAlignment="Center"
                              ContentSource="Header" Margin="10,5"
                              RecognizesAccessKey="True">
                                <ContentPresenter.LayoutTransform>
                                    <RotateTransform Angle="0" />
                                </ContentPresenter.LayoutTransform>
                            </ContentPresenter>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter TargetName="Border" Property="Background" Value="#FFF0F2F3"  />
                            <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="DarkRed" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="Black" />
                            <Setter Property="Foreground" Value="DarkGray" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

    <Style x:Key="TabControlStype" TargetType="TabControl" >
        <Setter Property="TabControl.Background" Value="#3CFFFFFF" />
        <Setter Property="BorderBrush" Value="Gray" />
        <Setter Property="BorderThickness" Value="1" />
    </Style>

    <Style TargetType="{x:Type ListBoxItem}" x:Key="ContainerStyle">
        <Setter Property="ContentTemplate" Value="{StaticResource ItemTemplate}"/>
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="ContentTemplate" Value="{StaticResource SelectedTemplate}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <DataTemplate x:Key="ItemTemplate">
        <TextBlock Text="{Binding}" Foreground="Red"/>
    </DataTemplate>

    <DataTemplate x:Key="SelectedTemplate">
        <TextBlock Text="{Binding}" Foreground="White"/>
    </DataTemplate>

    <Style x:Key="BorderStyle" TargetType="Border" >
        <Setter Property="Margin" Value="0" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="Gray" />
        <Setter Property="CornerRadius" Value="5" />
        <Setter Property="Background" Value="#4CFFFFFF" />
    </Style>

    <Style x:Key="BorderShadowStyle" TargetType="Border" >
        <Setter Property="Border.Effect">
            <Setter.Value>
                <DropShadowEffect ShadowDepth="3" Opacity="0.1" Direction="315" />
            </Setter.Value>
        </Setter>
        <Setter Property="Margin" Value="0" />
        <Setter Property="Padding" Value="5" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="Gray" />
        <Setter Property="CornerRadius" Value="5" />
        <Setter Property="Background" Value="#CCFFFFFF" />
    </Style>

    <Style x:Key="GroupBoxShadowStyle" TargetType="GroupBox" >
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Border BorderThickness="1,1,1,0" BorderBrush="#FFA8A8A8" CornerRadius="3,3,0,0" Background="#CCFFFFFF" Margin="0,0,-3,22" Padding="15,5,15,0">
                        <TextBlock Text="{Binding}"/>
                    </Border>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="GroupBox.Effect">
            <Setter.Value>
                <DropShadowEffect ShadowDepth="3" Opacity="0.1" Direction="325" />
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#FFA8A8A8" />
        <Setter Property="Padding" Value="10,0,10,0" />
        <Setter Property="Background" Value="#CCFFFFFF" />
    </Style>

    <Style x:Key="CommonStyle" TargetType="FrameworkElement" >
        <Setter Property="Control.Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,40" StartPoint="0,0" MappingMode="Absolute" Opacity="0.5">
                    <GradientStop Color="#FFDAD9D9" Offset="0"/>
                    <GradientStop Color="#FFFFFFFF" Offset="0.151"/>
                    <GradientStop Color="#FFE7E7E7" Offset="0.032"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>

        <Setter Property="Control.BorderBrush" Value="#FFBDBDB4"/>
        <Setter Property="Control.BorderThickness" Value="1,1,1,1"/>
    </Style>


    <Style x:Key="InfoStyle" TargetType="{x:Type TextBlock}">
        <Setter Property="Padding" Value="5"/>
        <Setter Property="Margin" Value="2"/>
        <Setter Property="Foreground" Value="Gray"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="MaxWidth" Value="700"/>
    </Style>

    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Padding" Value="5"></Setter>
        <Setter Property="Margin" Value="2"></Setter>
        <Setter Property="Control.Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,40" StartPoint="0,0" MappingMode="Absolute">
                    <GradientStop Color="#FFDAD9D9" Offset="0"/>
                    <GradientStop Color="White" Offset="0.151"/>
                    <GradientStop Color="#FFE7E7E7" Offset="0.032"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Control.BorderBrush" Value="#FFBDBDB4"/>
        <Setter Property="Control.BorderThickness" Value="1,1,1,1"/>
        <Style.Triggers>
            <Trigger Property="Validation.HasError" Value="true">
                <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type ComboBox}">
        <Setter Property="Padding" Value="7"></Setter>
        <Setter Property="Margin" Value="2"></Setter>
    </Style>

    <Style TargetType="{x:Type ListBox}">
        <Setter Property="Padding" Value="1"></Setter>
        <Setter Property="Margin" Value="2"></Setter>
    </Style>

    <Style TargetType="{x:Type Button}">
        <Setter Property="Padding" Value="25,4"></Setter>
        <Setter Property="Margin" Value="2"></Setter>
    </Style>

    <Style TargetType="{x:Type CheckBox}">
        <Setter Property="Padding" Value="7"></Setter>
        <Setter Property="Margin" Value="2"></Setter>
    </Style>

    <Style TargetType="{x:Type PasswordBox}">
        <Setter Property="Padding" Value="5"></Setter>
        <Setter Property="Margin" Value="2"></Setter>
        <Setter Property="Control.Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,40" StartPoint="0,0" MappingMode="Absolute">
                    <GradientStop Color="#FFDAD9D9" Offset="0"/>
                    <GradientStop Color="White" Offset="0.151"/>
                    <GradientStop Color="#FFE7E7E7" Offset="0.032"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Control.BorderBrush" Value="#FFBDBDB4"/>
        <Setter Property="Control.BorderThickness" Value="1,1,1,1"/>
    </Style>

    <ControlTemplate x:Key="ButtonWithoutBackground" TargetType="Button">
        <Grid Cursor="Hand">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard/>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard/>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <ContentPresenter
    			x:Name="contentPresenter"
    			Content="{TemplateBinding Content}"
    			ContentTemplate="{TemplateBinding ContentTemplate}"
    			VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
    			HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
    			Margin="{TemplateBinding Padding}"/>
            <Rectangle x:Name="DisabledVisualElement" RadiusX="3" RadiusY="3" Fill="#FFFFFFFF" Opacity="0" IsHitTestVisible="false"/>
            <Rectangle x:Name="FocusVisualElement" RadiusX="2" RadiusY="2" Margin="1" Stroke="#FF6DBDD1" StrokeThickness="1" Opacity="0" IsHitTestVisible="false"/>
        </Grid>
    </ControlTemplate>
</ResourceDictionary>
